<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>针对用户的管理策略</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />

        <!-- basic styles -->

        <link href="../../assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="../../assets/css/font-awesome.min.css" />

        <!--        <link rel="stylesheet" href="../../assets/css/datepicker.css" />
                <link rel="stylesheet" href="../../assets/css/bootstrap-timepicker.css" />-->
        <link type="text/css" rel="stylesheet" href="../../assets/js/plugin/jquery-ui/css/jquery-ui.css" />
        <!--<link rel="stylesheet" type="text/css" media="all" href="../../assets/js/date-time/daterangepicker-bs3.css"/>-->
        <link rel="stylesheet" href="../../assets/css/ace.min.css" />
        <link rel="stylesheet" href="../../assets/css/ace-rtl.min.css" />
        <link rel="stylesheet" href="../../assets/css/ace-skins.min.css" />
        <link rel="stylesheet" href = "../../assets/js/plugin/laydate/need/laydate.css" />
        <!--[if lte IE 8]>
          <link rel="stylesheet" href="../../assets/css/ace-ie.min.css" />
        <![endif]-->
        <script src="../../assets/js/ace-extra.min.js"></script>
        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
        <script src="../../assets/js/html5shiv.js"></script>
        <script src="../../assets/js/respond.min.js"></script>
        <![endif]-->

        <style>
            @font-face { 
                font-family: "Open Sans"; /*这里是说明调用来的字体名字*/ 
                src: url('../../assets/font/OpenSans-Regular.ttf'); /*这里是字体文件路径*/ 
            } 
        </style>
    </head>

    <body>

        <div class="main-container">
            <div class="page-content">

                <div class="row">
                    <div class="col-sm-12">
                        <h4 style="padding-left:20px; margin-top: 20px;" class='header smaller lighter blue'>一拖N用户管理策略添加</h4>
                        <form class="form-horizontal" role="form">	
                            <div class="form-group">
                                <label for="policy-name" class="col-sm-3 control-label no-padding-right"> 策略名称 </label>
                                <div class="col-sm-9">
                                    <input type="text" class="input-medium policy_desc" placeholder="" id="policy-name" name="policy-name" required>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="C_type" class="col-sm-3 control-label no-padding-right"> 1拖N用户管理策略 </label>

                                <div class="col-sm-9">
                                    <select id="C_type" class="form-control input-large">
                                        <option value="1">推送警示信息</option>
                                        <option value="32">重置所有HTTP链接</option>
                                        <option value="33">按一定比例重置HTTP链接(1/2-1/16)</option>

                                        <option value="48">按一定比例重置TCP链接(1/2-1/16)</option>

                                        <option value="64">对某类应用进行丢弃</option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-3 control-label no-padding-right"> 管理时间 </label>

                                <div class="col-sm-9">
                                    从 
                                    <div class="input-group bootstrap-timepicker input-medium" style="display: inline-block;">
                                        <input id="C_Starttime" type="text" class="form-control">
                                    </div>
                                    到 
                                    <div class="input-group bootstrap-timepicker input-medium" style="display: inline-block;">
                                        <input id="C_Stoptime" type="text" class="form-control">
                                    </div>
                                    <button id="add-time" class="btn btn-info btn-sm" type="button">
                                        <i class="icon-plus bigger-110"></i>
                                        添加
                                    </button>

                                    <!-- <textarea placeholder="" id="" class="form-control input-large" style="height: 89px; resize: none; margin-top:5px;"></textarea> -->

                                    <ul id="list" class=""></ul>

                                </div>
                            </div>

                            <div class="form-group">
                                <label for="Adv_URL" class="col-sm-3 control-label no-padding-right"> 警示信息URL </label>

                                <div class="col-sm-9">
                                    <input type="text" class="input-medium" id="Adv_URL" placeholder="" required>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="Drop_Protocol" class="col-sm-3 control-label no-padding-right"> 待管理应用类型 </label>

                                <div class="col-sm-9">
                                    <select class="form-control input-medium" id="Drop_Protocol">
                                        <option value="0">未识别应用</option>
                                        <option value="1">Web视频类</option>
                                        <option value="2">其它Web类</option>
                                        <option value="3">P2PStream</option>
                                        <option value="4">P2PDownload</option>
                                        <option value="5">VideoStream</option>
                                        <option value="6">Download</option>
                                        <option value="7">Email</option>
                                        <option value="8">IM</option>
                                        <option value="9">Game</option>
                                        <option value="10">Voip</option>
                                        <option value="11">电信自营</option>
                                        <option value="12">其它</option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="Packet_Drop_Ratio" class="col-sm-3 control-label no-padding-right"> 非法用户丢包比例 </label>

                                <div class="col-sm-9">
                                    <input type="text" class="input-medium" id="Packet_Drop_Ratio" placeholder="" required />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-offset-3 col-md-9 col-sm-offset-3 col-sm-9">
                                    <button type="button" class="btn btn-sm btn-danger up">
                                        <i class="icon-arrow-left"></i>
                                        查看上一个版本
                                    </button>
                                    &nbsp; &nbsp; &nbsp;
                                    <button type="button" class="btn btn-sm btn-danger next" disabled="">
                                        <i class="icon-arrow-right"></i>
                                        查看下一个版本
                                    </button>
                                    &nbsp; &nbsp; &nbsp;
                                    <button type="button" class="btn btn-sm btn-danger" onclick="previous();">
                                        <i class="icon-undo"></i>
                                        返回
                                    </button>
                                </div>
                            </div>

                        </form>

                    </div>

                </div>

            </div>
        </div>

        <!--[if !IE]> -->
        <script src="../../assets/js/jquery.js"></script>
        <!-- <![endif]-->
        <!--[if IE]>
        <script type="text/javascript">
         window.jQuery || document.write("<script src='../../assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
        </script>
        <![endif]-->
        <script src="../../assets/js/bootstrap.min.js"></script>
        <script src="../../assets/js/plugin/jquery-ui/jquery-ui.js"></script>
        <!--        <script src="../../assets/js/date-time/moment.js"></script>
        <script src="../../assets/js/date-time/daterangepicker.js"></script>-->
        <script src="../../assets/js/plugin/laydate/laydate.js"></script>
        <script src="../../assets/js/jquery.validate.js"></script>
        <script src="../../assets/js/jquery.validate-util.js"></script>
        <script src="../../assets/js/ace-elements.min.js"></script>
        <script src="../../assets/js/ace.min.js"></script>
        <script src="../../assets/js/plugin/menu/menu.js"></script>
        <script src="../../assets/js/Base64.js"></script>
        <script src="logic.js"></script>

        <script type="text/javascript">
                                        var base64 = new Base64();
                                        var type = getQueryString("type");
                                        var DepotID = getQueryString("DepotID");
                                        var DepotName = getQueryString("DepotName");
                                        DepotName = base64.decode(DepotName);
                                        var id = getQueryString("id");

                                        // 移除时间
                                        function delTime(obj) {
                                            $(obj).parent("li").remove();
                                        }

                                        var policyArray, policyAmount, actualQuantity;
                                        $(function() {
                                            getAllPolicy();
                                            //初始化数据
                                            actualQuantity = policyAmount - 1;
                                            show_oldPolicy(policyArray, actualQuantity);
                                            if (actualQuantity == 0) {
                                                $(".up").attr("disabled", "");
                                            }
                                            if (actualQuantity == (policyAmount - 1)) {
                                                $(".next").attr("disabled", "");
                                            }
                                            $(".up").click(function() {
                                                $("#list").html("");
                                                actualQuantity = actualQuantity - 1;
                                                show_oldPolicy(policyArray, actualQuantity);
                                                $(".next").removeAttr("disabled");
                                                if (actualQuantity == 0) {
                                                    $(".up").attr("disabled", "");
                                                }
                                            });
                                            $(".next").click(function() {
                                                $("#list").html("");
                                                actualQuantity = actualQuantity + 1;
                                                show_oldPolicy(policyArray, actualQuantity);
                                                $(".up").removeAttr("disabled");
                                                if (actualQuantity == (policyAmount - 1)) {
                                                    $(".next").attr("disabled", "");
                                                }
                                            });
                                        })
        </script>
    </body>
</html>
